load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:rust_unittest.bzl", "rust_unittest")

oncall("scm_server_infra")

rust_library(
    name = "git_ref_content_mapping",
    srcs = glob([
        "src/**/*.rs",
        "schemas/**/*.sql",
    ]),
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:arc-swap",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/stats:stats",
        "//eden/mononoke/common/rust/sql_ext:sql_ext",
        "//eden/mononoke/common/sql_construct:sql_construct",
        "//eden/mononoke/features/repo_update_logger:repo_update_logger",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/server/context:context",
    ],
)

rust_unittest(
    name = "git_ref_content_mapping_test",
    srcs = glob(["test/**/*.rs"]),
    crate = "git_ref_content_mapping_test",
    deps = [
        "fbsource//third-party/rust:anyhow",
        ":git_ref_content_mapping",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/common/sql_construct:sql_construct",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/mononoke_types:mononoke_types-mocks",
        "//eden/mononoke/server/context:context",
    ],
)
